AssertionError: Test case is leaking async ops.
例
これらはleakにならないっぽい
code:sample.ts
Deno.test("leaking async ops", async () => {
const promise = new Promise((resolve) => {
(async () => {
await new Promise<void>((res) => setTimeout(res, 1000));
console.log("The async function is done");
});
resolve("finish?");
});
console.log(await promise);
});
code:sample2.ts
Deno.test("leaking async ops", async () => {
let resolve: (value: string) => void = () => {};
const promise = new Promise((res2) => {
resolve = res2;
(async () => {
await new Promise<void>((res) => setTimeout(res, 1000));
console.log("The async function is done");
});
});
resolve("finish?");
console.log(await promise);
});
う~ん、leakする条件がいまいちわからない……takker.icon